BattleManager.isBattlerATBReady = function(battler) {
    if (this.haveBattlerHasAction()) return false;    //有人吟唱时，禁止atb完成
    if (battler.atbRate() < 1) return false;
    if (battler.isATBCharging()) return false;
    //if (battler.currentAction() && battler.currentAction().item()) {
    // 修复在点击指令后、尚未选择目标时，判定为atbready并使角色提前转变为atbcharge的错误。
    if (battler.currentAction() && battler.currentAction().item() && battler.currentAction()._targetIndex !== -1) {
      battler.makeActions();
      battler.setupATBCharge();
      return false;
    }
    return true;
};


BattleManager.isBattlerATBFastest = function(battler) {
    return battler === this.getReadyATBBattler() 
};

// 小C：存在确认行动角色
BattleManager.haveBattlerHasAction = function(){
    const partyResult =  $gameParty.battleMembers().some(function(actor){
        return !!actor.currentAction() && actor.isATBCharging();
    });

    const troopResult = $gameTroop.members().some(function(enemy){
        if(enemy.isDoppelganger())
            return false;
        else
            return !!enemy.currentAction() && enemy.isATBCharging();
    });

    return partyResult || troopResult
};